package eleanor.ltd.isRealEstate.entities.estate;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.beaneditor.NonVisual;

import eleanor.ltd.isRealEstate.entities.client.Client;


@Entity
@Table(name = "estate")
public class Estate {

	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "eid")
	private Long id;
	@Property
	@Column(name = "sellorrent")
	private String sellOrRent;
	@Property
	@Column(name = "type")
	private String type;
	@Property
	@Column(name = "town")
	private String town;
	@Property
	@Column(name = "address")
	private String address;
	@Property
	@Column(name = "country")
	private String country;
	@Property
	@Column(name = "subject")
	private String subject;
	@Property
	@Column(name = "size")
	private double size;
	@Property
	@Column(name = "water")
	private String water;
	@Property
	@Column(name = "electricity")
	private String electricity;
	@Property
	@Column(name = "description")
	private String description;
	@Property
	@Column(name = "price")
	private double price;
	@Property
	@Column(name = "dateOfCreation")
	private Date dateOfCreation;
	@Property
	@Column(name = "imagePath")
	private String imagePath;
	@Property
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "id")
	private Client client;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getSellOrRent() {
		return sellOrRent;
	}
	public void setSellOrRent(String sellOrRent) {
		this.sellOrRent = sellOrRent;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getTown() {
		return town;
	}
	public void setTown(String town) {
		this.town = town;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	public double getSize() {
		return size;
	}
	public void setSize(double size) {
		this.size = size;
	}
	public String getWater() {
		return water;
	}
	public void setWater(String water) {
		this.water = water;
	}
	public String getElectricity() {
		return electricity;
	}
	public void setElectricity(String electricity) {
		this.electricity = electricity;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public Date getDateOfCreation() {
		return dateOfCreation;
	}
	public void setDateOfCreation(Date dateOfCreation) {
		this.dateOfCreation = dateOfCreation;
	}
	public String getImagePath() {
		return imagePath;
	}
	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}
	public Client getClient() {
		return client;
	}
	public void setClient(Client client) {
		this.client = client;
	}
	
	
	
	
	
}
